package com.richrail.console.commands;

import com.richrail.model.entities.DepotStorage;

public class AddCommand
{
	private DepotStorage depotStorage;
	
	public void setDepotStorage(DepotStorage depotStorage)
	{
		this.depotStorage = depotStorage;
	}
	
	public String execute(String wagonName, String trainName)
	{
		return depotStorage.addWagonToTrain(wagonName, trainName)
			? "wagon " + wagonName + " added to train " + trainName
			: "wagon " + wagonName + " could not be added to train " + trainName;
	}
}
